import request from '@/utils/request'

export const getRoleList = params => request({
  url: '/sys/role',
  params // 查询参数
})

// 新增角色
export const addRole = data => request({
  url: '/sys/role',
  method: 'post',
  data
})

// 获取角色详情
export const getRole = id => request({
  url: `/sys/role/${id}`
})

// 修改角色信息
export const updateRole = data => request({
  method: 'PUT',
  url: `/sys/role/${data.id}`,
  data
})

//删除角色
export function delRole(id) {return request({ 
  url: `/sys/role/${id}`, 
  method: 'delete'
})
}
